/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Dealer.java
 *
 * Created on Oct 29, 2011, 3:44:20 PM
 */
package VIMS;
import java.sql.*;
import javax.swing.JOptionPane;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.MaskFormatter;


/**
 *
 * @author shyan
 */
public class Dealer extends javax.swing.JFrame {

    private Database dbOB = new Database();
    private ResultSet rset = null;
    private String action ="";
    private String selectedID=null;
    /** Creates new form Dealer */
    public Dealer() {
        super("Add New Dealer");
        initComponents();
        setLocationRelativeTo(null);
    }
    
     public Dealer(String choice,String selectedRowID) 
    {
        super(choice+" Dealer");
        initComponents();
        setLocationRelativeTo(null);  
        action=choice;
        selectedID=selectedRowID;
       // FileChooser.setVisible(false);
        if(action.equals("Add"))
        {      
            DealerButton.setText(action);
            NextDealerID();
            FormattedField();
        }
        if(action.equals("Delete"))
        {
            DealerButton.setText(action);
            ComponentDISABLED();
            DisplayDealerInfo();
        }
        if(action.equals("View"))
        {
            DealerButton.setVisible(false);
            CancelButton.setText("Back");
            ComponentDISABLED();
            DisplayDealerInfo();
        }

    }

     
     
    // Set Dealer IC, Contact and Post Code and Dealer assistant contact as Formatted Field
    private void FormattedField()
    {
        try 
        {   MaskFormatter fmtr1 = new MaskFormatter("######-##-####");   
            fmtr1.setPlaceholderCharacter('_');   
            fmtr1.setValueContainsLiteralCharacters(false);   
            IC.setFormatterFactory(new DefaultFormatterFactory(fmtr1));  
            
            MaskFormatter fmtr2 = new MaskFormatter("###-#######");   
            fmtr2.setPlaceholderCharacter('_');   
            fmtr2.setValueContainsLiteralCharacters(false);
            Contact.setFormatterFactory(new DefaultFormatterFactory(fmtr2));
            DassContact.setFormatterFactory(new DefaultFormatterFactory(fmtr2));
            
            MaskFormatter fmtr3 = new MaskFormatter("#####");   
            fmtr3.setValueContainsLiteralCharacters(false);
            PostCode.setFormatterFactory(new DefaultFormatterFactory(fmtr3)); 
        } 
        catch (java.text.ParseException ex) 
        {   
            ex.printStackTrace();
        }
    }
    
    // Retrive Next New Dealer ID 
    private void NextDealerID() 
    { 
        int currentNewEnum=0;
        Database ob = new Database();
        ResultSet rset = ob.getResultSet("SELECT MAX(D_ID) FROM dealer");
        try{
            if(rset.next())
                currentNewEnum=rset.getInt(1)+1;
           }
        catch(SQLException ex)
           {
             ex.printStackTrace();
           }
        ID.setText(Integer.toString(currentNewEnum));
    }
    
    // Retrive Dealer information
    private void DisplayDealerInfo()
    {
        String SQL= "SELECT * FROM dealer WHERE D_ID ="+selectedID;
        rset = dbOB.getResultSet(SQL);
        try
        {
          if(rset.next())
          {
                ID.setText(rset.getString(1));
                FirstName.setText(rset.getString(2));
                LastName.setText(rset.getString(3));
                IC.setText(rset.getString(4));
                Contact.setText(rset.getString(5));
                Email.setText(rset.getString(6));
                Address.setText(rset.getString(7));
                PostCode.setText(rset.getString(8));
                City.setText(rset.getString(9));
                DassName.setText(rset.getString(11));
                DassContact.setText(rset.getString(12));
                DassEmail.setText(rset.getString(13));
                Status.setSelectedItem(rset.getString(14));
                Gender.setSelectedItem(rset.getString(15));
                Race.setSelectedItem(rset.getString(16));
                Religion.setSelectedItem(rset.getString(17)); 
                UserName.setText(rset.getString(18));
                Company.setText(rset.getString(19));

          }
        }
        catch(Exception ex)
        {
            ex.printStackTrace();
        }  
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLayeredPane1 = new javax.swing.JLayeredPane();
        DidLabel = new javax.swing.JLabel();
        ID = new javax.swing.JLabel();
        DnLabel = new javax.swing.JLabel();
        UserName = new javax.swing.JTextField();
        DFnLabel = new javax.swing.JLabel();
        FirstName = new javax.swing.JTextField();
        DLnLabel = new javax.swing.JLabel();
        LastName = new javax.swing.JTextField();
        DIcLabel = new javax.swing.JLabel();
        IC = new javax.swing.JFormattedTextField();
        DEmailLabel = new javax.swing.JLabel();
        Email = new javax.swing.JTextField();
        DConLabel = new javax.swing.JLabel();
        Contact = new javax.swing.JFormattedTextField();
        DGenderLabel = new javax.swing.JLabel();
        Gender = new javax.swing.JComboBox();
        DRaceLabel = new javax.swing.JLabel();
        Race = new javax.swing.JComboBox();
        DReligionLabel = new javax.swing.JLabel();
        Religion = new javax.swing.JComboBox();
        DcompanyLabel = new javax.swing.JLabel();
        Company = new javax.swing.JTextField();
        DstatusLabel = new javax.swing.JLabel();
        Status = new javax.swing.JComboBox();
        DCityLabel = new javax.swing.JLabel();
        City = new javax.swing.JTextField();
        DPostCodeLabel = new javax.swing.JLabel();
        PostCode = new javax.swing.JFormattedTextField();
        DAddLabel = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        Address = new javax.swing.JEditorPane();
        DealerButton = new javax.swing.JButton();
        CancelButton = new javax.swing.JButton();
        V_Separator = new javax.swing.JSeparator();
        D_IPNameLabel = new javax.swing.JLabel();
        DassName = new javax.swing.JTextField();
        D_IPContactLabel = new javax.swing.JLabel();
        DassContact = new javax.swing.JFormattedTextField();
        D_IPEmailLabel = new javax.swing.JLabel();
        DassEmail = new javax.swing.JTextField();
        Border1 = new javax.swing.JLabel();
        Border2 = new javax.swing.JLabel();
        Border3 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(800, 600));

        jLayeredPane1.setMaximumSize(new java.awt.Dimension(800, 600));
        jLayeredPane1.setMinimumSize(new java.awt.Dimension(800, 600));

        DidLabel.setText("Dealer ID :");
        DidLabel.setBounds(60, 60, 80, 30);
        jLayeredPane1.add(DidLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        ID.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        ID.setBounds(150, 60, 150, 30);
        jLayeredPane1.add(ID, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DnLabel.setText("User name :");
        DnLabel.setBounds(60, 100, 80, 30);
        jLayeredPane1.add(DnLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        UserName.setBounds(150, 100, 150, 30);
        jLayeredPane1.add(UserName, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DFnLabel.setText("First name :");
        DFnLabel.setBounds(60, 140, 80, 30);
        jLayeredPane1.add(DFnLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        FirstName.setBounds(150, 140, 150, 30);
        jLayeredPane1.add(FirstName, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DLnLabel.setText("Last name :");
        DLnLabel.setBounds(60, 180, 80, 30);
        jLayeredPane1.add(DLnLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        LastName.setBounds(150, 180, 150, 30);
        jLayeredPane1.add(LastName, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DIcLabel.setText("IC no.       :");
        DIcLabel.setBounds(60, 220, 80, 30);
        jLayeredPane1.add(DIcLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        IC.setBounds(150, 220, 150, 30);
        jLayeredPane1.add(IC, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DEmailLabel.setText("Email         :");
        DEmailLabel.setBounds(60, 260, 70, 30);
        jLayeredPane1.add(DEmailLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        Email.setBounds(150, 260, 150, 30);
        jLayeredPane1.add(Email, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DConLabel.setText("Contact    :");
        DConLabel.setBounds(60, 300, 70, 30);
        jLayeredPane1.add(DConLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        Contact.setBounds(150, 300, 150, 30);
        jLayeredPane1.add(Contact, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DGenderLabel.setText("Gender    :");
        DGenderLabel.setBounds(60, 340, 70, 30);
        jLayeredPane1.add(DGenderLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Gender.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose", "Male", "Female" }));
        Gender.setBounds(150, 340, 80, 30);
        jLayeredPane1.add(Gender, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DRaceLabel.setText("Race        :");
        DRaceLabel.setBounds(60, 380, 70, 30);
        jLayeredPane1.add(DRaceLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Race.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose", "Chinese", "Malay", "Indian", "Other" }));
        Race.setBounds(150, 380, 80, 30);
        jLayeredPane1.add(Race, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DReligionLabel.setText("Religion    :");
        DReligionLabel.setBounds(60, 420, 70, 30);
        jLayeredPane1.add(DReligionLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Religion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose", "Buddha", "Islam", "Hindu", "Other" }));
        Religion.setBounds(150, 420, 80, 30);
        jLayeredPane1.add(Religion, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DcompanyLabel.setText("Dealer's Company :");
        DcompanyLabel.setBounds(390, 60, 120, 30);
        jLayeredPane1.add(DcompanyLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        Company.setBounds(510, 60, 260, 30);
        jLayeredPane1.add(Company, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DstatusLabel.setText("Status :");
        DstatusLabel.setBounds(390, 100, 80, 30);
        jLayeredPane1.add(DstatusLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Status.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Choose", "ACTIVE", "INACTIVE" }));
        Status.setBounds(510, 100, 110, 30);
        jLayeredPane1.add(Status, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DCityLabel.setText("City          :");
        DCityLabel.setBounds(390, 140, 70, 30);
        jLayeredPane1.add(DCityLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        City.setBounds(510, 140, 160, 30);
        jLayeredPane1.add(City, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DPostCodeLabel.setText("Postcode  :");
        DPostCodeLabel.setBounds(390, 180, 70, 30);
        jLayeredPane1.add(DPostCodeLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        PostCode.setBounds(510, 180, 160, 30);
        jLayeredPane1.add(PostCode, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DAddLabel.setText("Address    :");
        DAddLabel.setBounds(390, 220, 70, 30);
        jLayeredPane1.add(DAddLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jScrollPane1.setViewportView(Address);

        jScrollPane1.setBounds(510, 220, 160, 120);
        jLayeredPane1.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        DealerButton.setText("Add");
        DealerButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                DealerButtonActionPerformed(evt);
            }
        });
        DealerButton.setBounds(620, 560, 80, 30);
        jLayeredPane1.add(DealerButton, javax.swing.JLayeredPane.DEFAULT_LAYER);

        CancelButton.setText("Cancel");
        CancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CancelButtonActionPerformed(evt);
            }
        });
        CancelButton.setBounds(700, 560, 80, 30);
        jLayeredPane1.add(CancelButton, javax.swing.JLayeredPane.DEFAULT_LAYER);

        V_Separator.setOrientation(javax.swing.SwingConstants.VERTICAL);
        V_Separator.setBounds(350, 0, 10, 610);
        jLayeredPane1.add(V_Separator, javax.swing.JLayeredPane.DEFAULT_LAYER);

        D_IPNameLabel.setText("Name :");
        D_IPNameLabel.setBounds(390, 390, 80, 30);
        jLayeredPane1.add(D_IPNameLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        DassName.setBounds(510, 390, 160, 30);
        jLayeredPane1.add(DassName, javax.swing.JLayeredPane.DEFAULT_LAYER);

        D_IPContactLabel.setText("Contact :");
        D_IPContactLabel.setBounds(390, 430, 80, 30);
        jLayeredPane1.add(D_IPContactLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        DassContact.setBounds(510, 430, 160, 30);
        jLayeredPane1.add(DassContact, javax.swing.JLayeredPane.DEFAULT_LAYER);

        D_IPEmailLabel.setText("Email :");
        D_IPEmailLabel.setBounds(390, 470, 80, 30);
        jLayeredPane1.add(D_IPEmailLabel, javax.swing.JLayeredPane.DEFAULT_LAYER);
        DassEmail.setBounds(510, 470, 160, 30);
        jLayeredPane1.add(DassEmail, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Border1.setFont(new java.awt.Font("Tahoma", 1, 18));
        Border1.setBorder(javax.swing.BorderFactory.createTitledBorder("Dealer's Personal Details :"));
        Border1.setBounds(30, 30, 300, 440);
        jLayeredPane1.add(Border1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Border2.setFont(new java.awt.Font("Tahoma", 1, 18));
        Border2.setBorder(javax.swing.BorderFactory.createTitledBorder("Dealer's Company Details :"));
        Border2.setBounds(370, 30, 420, 320);
        jLayeredPane1.add(Border2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Border3.setBorder(javax.swing.BorderFactory.createTitledBorder("Dealer's Contact Person :"));
        Border3.setBounds(370, 360, 420, 170);
        jLayeredPane1.add(Border3, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 800, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 600, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    
    private void CancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CancelButtonActionPerformed
        this.setVisible(false);
    }//GEN-LAST:event_CancelButtonActionPerformed

    private void DealerButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_DealerButtonActionPerformed
        if(DealerButton.getText().equals("Delete"))
        {
            Status.setSelectedItem("INACTIVE");
            DeleteDealer();
        }
        else 
            AddDealer();
    }//GEN-LAST:event_DealerButtonActionPerformed

    private void AddDealer()
    {
        String D_ID       =ID.getText();
        String D_FNAME    =FirstName.getText().trim();
        String D_LNAME    =LastName.getText().trim();
        String D_IC       =IC.getText();
        String D_CONTACT  =Contact.getText();
        String D_EMAIL    =Email.getText().trim();
        String D_ADDRESS  =Address.getText().trim();
        String D_POSTCODE =PostCode.getText();
        String D_CITY     =City.getText().trim();
        String AssName    =DassName.getText().trim();
        String AssCon     =DassContact.getText();
        String AssEmail   =DassEmail.getText().trim();
        String D_STATUS   =Status.getSelectedItem().toString();
        String D_GENDER   =Gender.getSelectedItem().toString();
        String D_RACE     =Race.getSelectedItem().toString();
        String D_RELIGION =Religion.getSelectedItem().toString();
        String D_USERNAME   =UserName.getText().trim();
        String D_COM        =Company.getText().trim();
        
        
        int pwnum=0;
        String dIC=D_IC.substring(0, 6)+D_IC.substring(7,9)+D_IC.substring(10,14);
        String pwSQL= "INSERT INTO password (PW_PASSWORD,PW_DATE) VALUES(DES_ENCRYPT('"+dIC+"'),CURDATE())";
        
        if(D_FNAME.isEmpty() || D_LNAME.isEmpty() || D_IC.isEmpty() || D_CONTACT.isEmpty() || D_EMAIL.isEmpty() || D_ADDRESS.isEmpty()
                || D_POSTCODE.isEmpty() ||D_CITY.isEmpty() || AssName.isEmpty() || AssCon.isEmpty() || AssEmail.isEmpty() ||
                D_STATUS.equals("Choose") || D_GENDER.equals("Choose") || D_RACE.equals("Choose") || D_RELIGION.equals("Choose") ||
                D_USERNAME.isEmpty() || D_COM.isEmpty() )
        {
            JOptionPane.showMessageDialog(null, "Please fill up all information.");
        }
        else
        {
            String message = "Add a new dealer profile?";
            String title = "Confirmation?";
            int reply = JOptionPane.showConfirmDialog(null, message, title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
            if (reply == JOptionPane.YES_OPTION)
            {
                dbOB.update(pwSQL);
                rset=dbOB.getResultSet("SELECT MAX(PW_NUMBER) FROM password");
                try 
                {  
                    if(rset.next())
                        pwnum=Integer.parseInt(rset.getString(1).toString());
                      //System.out.println("num : "+pwnum);
                        
                        String SQL="INSERT INTO dealer VALUES ('"+D_ID+"','"+D_FNAME+"','"+D_LNAME+"','"+D_IC+"'"
                                + ",'"+D_CONTACT+"','"+D_EMAIL+"','"+D_ADDRESS+"','"+D_POSTCODE+"','"+D_CITY+"','"+pwnum+"','"+AssName+"'"
                                + ",'"+AssCon+"','"+AssEmail+"','"+D_STATUS+"','"+D_GENDER+"','"+D_RACE+"','"+D_RELIGION+"'"
                                + ",'"+D_USERNAME+"','"+D_COM+"')";
                      System.out.println("\n"+SQL);
                       
                        if(dbOB.update(SQL)==true)
                       {
                               JOptionPane.showMessageDialog(null,"New Dealer is added.");
                               this.setVisible(false);
                       }
                       else
                       {   
                                JOptionPane.showMessageDialog(null, "Data failed to be added into database.\nPlease check the entered information!");
                                //addOb.update("DELETE FROM password WHERE PW_NUMBER="+pwnum);
                       }   
                } 
                catch (SQLException ex) 
                {  ex.printStackTrace();}
   
            }
        }
    }
    
    
    private void DeleteDealer()
    {
        String title = "Confirmation";
        String msg   = "Deactivate dealer "+ID.getText()+" ?";
        int reply = JOptionPane.showConfirmDialog(null, msg, title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
        if(reply==JOptionPane.YES_OPTION)
        {
            String SQL="UPDATE dealer SET D_STATUS='INACTIVE' WHERE D_ID="+selectedID;
            if(dbOB.update(SQL)==true)
            {
                JOptionPane.showMessageDialog(null , "Employee "+ID.getText()+" has been Deactivated.");
                this.setVisible(false);
            }
            else
                JOptionPane.showMessageDialog(null , "Failure occurs during deletion.");
        }
        else
            Status.setSelectedItem("ACTIVE");
    }
    
    private void ComponentDISABLED()
    {
        UserName.setEditable(false);
        FirstName.setEditable(false);
        LastName.setEditable(false);
        IC.setEditable(false);
        Email.setEnabled(false);
        Contact.setEditable(false);
        Gender.setEnabled(false);
        Race.setEnabled(false);
        Religion.setEnabled(false);
        Company.setEditable(false);
        Status.setEnabled(false);
        City.setEditable(false);
        PostCode.setEditable(false);
        Address.setEditable(false);
        DassName.setEditable(false);
        DassContact.setEditable(false);
        DassEmail.setEditable(false);
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Dealer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Dealer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Dealer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Dealer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Dealer().setVisible(true);
                
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JEditorPane Address;
    private javax.swing.JLabel Border1;
    private javax.swing.JLabel Border2;
    private javax.swing.JLabel Border3;
    private javax.swing.JButton CancelButton;
    private javax.swing.JTextField City;
    private javax.swing.JTextField Company;
    private javax.swing.JFormattedTextField Contact;
    private javax.swing.JLabel DAddLabel;
    private javax.swing.JLabel DCityLabel;
    private javax.swing.JLabel DConLabel;
    private javax.swing.JLabel DEmailLabel;
    private javax.swing.JLabel DFnLabel;
    private javax.swing.JLabel DGenderLabel;
    private javax.swing.JLabel DIcLabel;
    private javax.swing.JLabel DLnLabel;
    private javax.swing.JLabel DPostCodeLabel;
    private javax.swing.JLabel DRaceLabel;
    private javax.swing.JLabel DReligionLabel;
    private javax.swing.JLabel D_IPContactLabel;
    private javax.swing.JLabel D_IPEmailLabel;
    private javax.swing.JLabel D_IPNameLabel;
    private javax.swing.JFormattedTextField DassContact;
    private javax.swing.JTextField DassEmail;
    private javax.swing.JTextField DassName;
    private javax.swing.JLabel DcompanyLabel;
    private javax.swing.JButton DealerButton;
    private javax.swing.JLabel DidLabel;
    private javax.swing.JLabel DnLabel;
    private javax.swing.JLabel DstatusLabel;
    private javax.swing.JTextField Email;
    private javax.swing.JTextField FirstName;
    private javax.swing.JComboBox Gender;
    private javax.swing.JFormattedTextField IC;
    private javax.swing.JLabel ID;
    private javax.swing.JTextField LastName;
    private javax.swing.JFormattedTextField PostCode;
    private javax.swing.JComboBox Race;
    private javax.swing.JComboBox Religion;
    private javax.swing.JComboBox Status;
    private javax.swing.JTextField UserName;
    private javax.swing.JSeparator V_Separator;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables
}
